/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package otherSites;

import de.swta.*;
import java.util.ArrayList;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.resources.StyleSheetReference;

/**
 *
 * @author JKorreck
 */
public class AllItems extends WebPage {

    private ArrayList<MyItem> addedItems = new ArrayList<MyItem>();

    public AllItems() {
        super();

        add(new Label("title", "New Item added"));
        add(new StyleSheetReference("stylesheet", MyItems.class, "style.css"));
    }

    public AllItems(MyItem itemModel) {
        this();

        this.add(new Label("id", itemModel.getId()));
        this.add(new Label("name", itemModel.getName()));
        this.add(new Label("weight", "" + itemModel.getWeight()));
        this.add(new Label("unit", "" + itemModel.getUnit()));
    }

    public void addItem(MyItem newItem) {

        this.addedItems.add(newItem);
        this.add(new Label("id", newItem.getId()));
        this.add(new Label("name", newItem.getName()));
        this.add(new Label("weight", "" + newItem.getWeight()));
        this.add(new Label("unit", "" + newItem.getUnit()));


    }
}
